import sys
reload(sys)


from app import app
from flask.ext.script import Manager, Server
from app.models import Post

manager = Manager(app)

manager.add_command("runserver",
        Server(host="0.0.0.0", port=9000, use_debugger=True))

@manager.command
def save_post():
    post = Post(author="kumikoda",
                title="Hello World",
                tags="test",
                content="This is the First Post")
    post.save()


if __name__ == '__main__':
    manager.run()
